package com.example.feign;

import com.example.config.FeignConfig;
import com.example.constant.ServiceConstant;
import com.example.constant.ServicePrefixConstant;
import com.example.dto.StorageDTO;
import com.example.feign.fallback.StorageFeignClientFallbackFactory;
import com.example.model.api.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 用户接口
 *
 * @author Mark sunlightcs@gmail.com
 */
@FeignClient(name = ServiceConstant.ADMIN_SERVER, contextId = "StorageFeignClient", fallbackFactory = StorageFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.ADMIN_SERVER, contextId = "StorageFeignClient", configuration = FeignConfig.class, fallbackFactory = StorageFeignClientFallbackFactory.class)
public interface StorageFeignClient {

    /**
     * 根据用户ID，获取用户信息
     */
    @PostMapping(ServicePrefixConstant.ADMIN_SERVER + "/storage")
    Result<String> updateStorage(@RequestBody StorageDTO storageDto);

    }